/*******************************************************************************
 * CopyRight (c) 2020 
 *
 * \file    mkv_output.c
 * \brief   output mkv stream to file
 * \author  ZhangJing
 * \version 1.0.0
 * \date    2020-07-08
 *
 * -----------------------------------------------------------------------------
 * Modify history：
 * <Date>       | <Version> | <Author>  | <Discribe>
 * 2020-07-08   | v1.0.0    | ZhangJing | Create file
 * -----------------------------------------------------------------------------
 ******************************************************************************/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "publicdef.h"
#include "print_ctrl.h"
#include "format.h"

/*!
 * \brief write header of stream file with different stream type
 */ 
int mkv_write_header(void *format_context)
{
    //TODO: write header info if mp3 stream, similar to mp3enc.c
}

/*!
 * \brief write packet of stream file with different stream type
 */ 
int mkv_write_packet(void *format_context)
{
    FormatContext *fc = format_context;
    Stream *st = fc->streams[0];

    pr_entry(in);

    fc->state = 1; /**< write packet */
    fc->fm->read_packet(fc);

    return 0;
}

/*!
 * \brief write header of stream file with different stream type
 */ 
int mkv_write_trailer(void *format_context)
{

}

OutputFormat mkv_output_format = {
    "mkv_output", ID_MKV,
    mkv_write_header, mkv_write_packet, mkv_write_trailer
};
